using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MWIS.Common;
using System.Resources;

public partial class _Default : System.Web.UI.Page
{
    MwisUser mwisUser = new MwisUser();

    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = Resources.MwisResources.regTitle;
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        bool inserted = false;

        #region Collecting Information

        mwisUser.UserName = txtUserName.Text;
        mwisUser.FName = txtFirstName.Text;
        mwisUser.LName = txtLastName.Text;
        mwisUser.MobileNumber = txtMobile.Text;
        mwisUser.Address = txtAddress.Text;
        mwisUser.District = drpdDistrict.SelectedItem.Text;
        mwisUser.Area = txtArea.Text;
        mwisUser.NationalId = txtNationalID.Text;
        mwisUser.Password = txtPassword.Text;
        mwisUser.EMail = txtEmail.Text;
        mwisUser.DateOfBirth = DateTime.Now;//Set this value

        #endregion

        if (mwisUser.CheckForUserName(mwisUser.UserName))
        {
            lblUserExistError.Visible = true;
            //Response.Write("<script language='javascript'>alert('User Name Exist.')</script>");
        }
        else
        {
            lblUserExistError.Visible = false;
            inserted = mwisUser.insertUser();
        }

        if (inserted)
        {
            //TODO:
        }
        else
        {
            //TODO:
        }
    }

    protected void lstMonth_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void txtUsrName_TextChanged(object sender, EventArgs e)
    {

    }
    protected void btnReset_Click(object sender, EventArgs e)
    {
        //Reset all text boxes.
       
        //chkAgree.Checked = false;
    }
}
